package site.zhangzhuo.v1;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashSet;

/**
 * @ClassName Yan
 * @Author "王二麻子"
 * @Date 2024/12/6 10:42
 * 眼
 **/
public class Yan {
    //眼通过看获得的相
    private final HashSet<String> result=new HashSet<>();

    //查看一段文字获得相
    public void readString(String text){
        for (int i = 0; i < text.length(); i++) {
            result.add(String.valueOf(text.charAt(i)));
        }
    }
    //读取文本文件获得相
    public void readFile(String fileFullPath){
        Path filePath = Path.of(fileFullPath);
        try {
            String content = Files.readString(filePath);
            readString(content);
            //System.out.println(this);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
    @Override
    public String toString(){
        return result.toString();
    }
}
